﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Public;

namespace DAL
{
    public class KhaiSinhDAL
    {
        public static KhaiSinhPublic LoadKhaiSinhByMaKS(int MaKS,string TenSever,string Data)
        {
            string chuoi = "select MaKS,SoKhaiSinh as SoKhaiSinh,NguoiDangKi,MaQH,NguoiCap,ChucVu,NgayCap,NoiSinh,NoiCap,ISNULL(MaNKC,0) as MaNKC,ISNULL(MaNKM,0) as MaNKM,CanBoDangKi,CanBoHoTich,NgayNhap,NguoiNhan,ChucVuNguoiNhan from [" + TenSever + "].[" + Data + "].[dbo].[KhaiSinh] where MaKS=" + MaKS;
            var ks = Common.db.ExecuteStoreQuery<KhaiSinhPublic>(chuoi);
            return ks.FirstOrDefault();
        }
    }
}
